package com.itheima.a03staticdemo01;

import java.util.ArrayList;

public class GetMax {
    private GetMax(){}

    public static int getMax(ArrayList<Student> list){
        int max = list.get(0).getAge();
        for (int i = 1; i < list.size(); i++) {
            int age = list.get(i).getAge();
            if (age > max) {
                max = age;
            }
        }
        return max;
    }
}
